package com.cloudkinto.dao;

import com.baomidou.mybatisplus.core.metadata.IPage;
import com.cloudkinto.entity.ProductStockRackDo;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.cloudkinto.extentity.ProductStockDetailDto;
import com.cloudkinto.extentity.ProductStockRackDto;
import com.cloudkinto.extentity.StockFlowingDto;
import com.cloudkinto.extentity.stock.*;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;
import java.util.Map;

/**
 * <p>
 * Mapper 接口
 * </p>
 *
 * @author hua`
 * @since 2022-12-21
 */
@Mapper
public interface ProductStockRackDao extends BaseMapper<ProductStockRackDo> {

    IPage<ProductStockRackDto> getListPage(IPage<ProductStockRackDto> page, @Param("map") Map<String, String> map);

    List<ProductStockRackDto> getListPage(@Param("map") Map<String, String> map);

    IPage<ProductStockDetailDto> getStockByRackId(IPage<ProductStockDetailDto> page, @Param("map") Map<String, String> map);

    ProductStockDetailDto getStockByRackId(@Param("map") Map<String, String> map);


    IPage<ProductStockDetailDto> getStockList(IPage<ProductStockDetailDto> page, @Param("map") Map<String, String> map);

    List<ProductStockDetailDto> getStockList(@Param("map") Map<String, String> map);

    List<ProductStockRackDo> getStockRackList(@Param("map") Map<String, String> map);

    List<PickupStockRackDto> getStockRackBySort(@Param("map") Map<String, String> map);

    List<ProductStockTotalDto> getStockRackTotalBySort(@Param("map") Map<String, String> map);


    IPage<StockFlowingDto> getFlowingList(IPage<StockFlowingDto> page, @Param("map") Map<String, String> map);

    ProductStockRackDo getOne(Long id);

    List<ProductStockRackDo> getLockingStockList(Long productId, Long storageId, Long rackId);

    ProductStockRackDo getLockingStock(Long productId, Long storageId, Long companyId);


    int updateStockById(Long id, int count);

    int updateLockStockById(Long id, int count);

    List<ProductStockDto> getProductList(@Param("map") Map<String, String> map);

    IPage<ProductStockDto> getProductList(@Param("page") IPage<ProductStockDto> page, @Param("map") Map<String, String> map);


    List<PositionOutVolRes> getPositionOutVolResList(@Param("map") Map<String, String> map);

}
